<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
  <head>
    <title>上传附件</title>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<style type="text/css">
.browserBtn{width: 24px; height: 24px;background: url('/mobilemode/apps/e-cology/email/imgs/search_icon_wev8.png') no-repeat;display: inline-block;vertical-align:middle;background-size: 24px 24px;}
</style>
<script type="text/javascript">
var index=1;
function addUpload(e,obj) {
	document.getElementById("fileindex").value = index++;
	var top = parent.document.getElementById("uploadIframe").offsetTop+20;
	location = "emobile:upload:callbackUpload:"+index+":"+top+":clearAppendix";
}

function callbackUpload(name,data,index) {
	if(data) document.getElementById('uploaddata').value = data;
	if(name) document.getElementById('uploadname').value = name;
	document.getElementById("dataForm").submit();
}

function showDocinfo(json){
	var isfirst = document.getElementById("isfirst");
	var docid = json["docid"];
	if(isfirst.value==-1){
		isfirst.value = 1;
		return;
	}
	if(parent.showDocinfo){
		parent.showDocinfo(json);
		if(isfirst.value==0){
			isfirst.value = 1;
		}else if(isfirst.value==1){
			history.go(-1);
			isfirst.value = -1;
		}
	}
}
</script>
  </head>
  <body style="margin: 0px;">
	    <div class="browserBtn" onclick="addUpload(event,this);" ></div>
	    <form action="/mobilemode/apps/e-cology/email/EmailFileUpload.jsp" enctype="multipart/form-data"  id="dataForm" name="dataForm" method="post" target="hidden_frame1">
			<input id="uploaddata" type="hidden" name="uploaddata" />
			<input id="uploadname" type="hidden" name="uploadname" />
			<input id="isfirst" type="hidden" name="isfirst" value="0" />
			<input id="fileindex" type="hidden" name="fileindex" value="1" />
		</form>
	    <iframe name='hidden_frame1' id="hidden_frame1" style='display:none'></iframe>
  </body>
</html>
